GroupBy(TSource, TKey) Method (ParallelQuery(TSource), Func(TSource, TKey))

Task Parallel System.Threading

Groups in parallel the elements of a sequence according to a specified key selector function.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function GroupBy(Of TSource, TKey) ( _
	source As ParallelQuery(Of TSource), _
	keySelector As Func(Of TSource, TKey) _
) As ParallelQuery(Of IGrouping(Of TKey, TSource))
C#
public static ParallelQuery<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(
	ParallelQuery<TSource> source,
	Func<TSource, TKey> keySelector
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
An OrderedParallelQuery{TSource}than contains elements to sort.
keySelector
Type: System..::.Func<(Of <(TSource, TKey>)>)
A function to extract a key from an element.

Type Parameters

TSource
The type of elements of source.
TKey
The type of the key returned by keySelector.

Return Value

An OrderedParallelQuery{TSource}whose elements are sorted descending according to a key.

See Also